#!/bin/bash
jdk7(){
    cd $dir && wget -V &> /dev/null || yum -y install wget
    java -version &> /dev/null && echoRed "检测到系统中有java命令，故而退出" && rm -rf $dir && exit 1
    wget $ip/pack/jdk-7u79-linux-x64.tar.gz -O jdk7.tar.gz && tar xf jdk7.tar.gz && mv jdk*/ /usr/local/jdk7
    echo 'JAVA_HOME=/usr/local/jdk7' >> /etc/profile && echo 'PATH=$PATH:$JAVA_HOME/bin' >> /etc/profile && echo 'export PATH' >> /etc/profile && source /etc/profile
    /usr/local/jdk7/bin/java -version &> /dev/null && echoGreen "已完成安装，可尽情享用" || echoYellow "可能安装有问题，请检查" 
    S && rm -rf $dir
}
